#include <STC15F2K60S2.H>

void LED_DisPlay(unsigned char Dat,Enable)
{
	unsigned char Temp=0x00;
	unsigned char Temp_Old=0xff;
	if(Enable)
		Temp=0x01<<Dat;
	else
		Temp&=~(0x01<<Dat);
	if(Temp!=Temp_Old)
	{
		P0=~Temp;
		P2=(P2&0x1f)|0x80;
		P2&=0x1f;
		Temp_Old=Temp;
	}
}


void Relay (unsigned char Enable)
{
	unsigned char Temp1=0x00;
	unsigned char Temp1_Old=0xff;
	if(Enable)
		Temp1=0x10;
	else
		Temp1&=~0x10;
	if(Temp1!=Temp1_Old)
	{
		P0=Temp1;
		P2=(P2&0x1f)|0xa0;
		P2&=0x1f;
		Temp1_Old=Temp1;
	}
}
